import 'package:flutter/material.dart';
class IgnorePointTest extends StatelessWidget{
  @override
  Widget build(BuildContext context) {
    return IgnorePointEx();
  }
}
class IgnorePointEx extends StatefulWidget{
  @override
  State<StatefulWidget> createState() {
    return _IgnorePointEx();
  }
}

class _IgnorePointEx extends State<IgnorePointEx>{
  bool ignoring = false;

  void setIgnoring(bool newValue){
    setState(() {
      ignoring = newValue;
    });
  }
  @override
  Widget build(BuildContext context) {
    return Scaffold(appBar: AppBar(title: ElevatedButton(
      onPressed: (){
        setIgnoring(!ignoring);
      },
      child: Text(ignoring ? 'Set ignoring to false' : 'Set ignoring to true'),
    ),),
      body: Center(
        child: IgnorePointer(
          ignoring: ignoring,
          child: Column(
            mainAxisAlignment: MainAxisAlignment.spaceEvenly,
            children: [
              Text('Ignoring:$ignoring'),
              ElevatedButton(onPressed: (){}, child: const Text('Click me!')),
            ],
          ),
        ),
      ),);
  }
}